package com.itheima.digui;

public class Demo02 {
    public static void main(String[] args) {
        System.out.println(1*2*3*4*5);
        System.out.println(getJC(5));
    }


    //定义方法 求任意数阶乘
    //参数 整数 int
    //返回值  int
    public static int getJC(int num){
        /*int ji=1;
        for (int i = 1; i <= num; i++) {
            ji*=i;
        }
        return ji;*/
        if(num==1){
            return 1;
        }
        return num*getJC(num-1);


    }
}
